package gui.panel_new.evaluation.student;

import model.eval.TestExcercise;

import javax.swing.*;
/*

    This file is part of Logica-Logike.

    Logica-Logike is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
    the Free Software Foundation version 3 of the License.

    Logica-Logike is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public License
    along with Logica-Logike.  If not, see <http://www.gnu.org/licenses/>.

 */
/**
 * @author Jose Martin Rozanec;
 */
public class ShowPanelsManager {

    /*
        excercisePanels[0]=oposicionPanel;
        excercisePanels[1]=sylogismViolationsPanel;
        excercisePanels[2]=sylogismReducirModosPanel;
        excercisePanels[3]=createMChoicePanel;
     */
    public static void setExercisePanelInfo(TestExcercise testExcercise, JPanel[] panels) {
        switch (testExcercise.getPanelEnum()) {
            case VIOLACIONES_SILOGISMO:
                SylogismViolationsPanel sylogismViolationsPanel = (SylogismViolationsPanel) panels[1];
                sylogismViolationsPanel.setExercise(testExcercise);
                break;
            case REDUCCION_MODOS:
                SylogismReducirModosPanel sylogismReducirModosPanel = (SylogismReducirModosPanel) panels[2];
                System.out.println("Setting exercise...");
                sylogismReducirModosPanel.setExercise(testExcercise);
                System.out.println("End of Setting exercise...");
                break;
            case MULTIPLE_CHOICE:
                MChoicePanel mChoicePanel = (MChoicePanel) panels[3];
                mChoicePanel.setExercise(testExcercise);
                break;
            case OPOSICION:
                OposicionEvaluationPanel oposicionEvaluationPanel = (OposicionEvaluationPanel) panels[0];
                oposicionEvaluationPanel.setExercise(testExcercise);
                break;
            case TRUTH_TABLE:
                TruthTableEvaluationPanel truthTableEvaluationPanel = (TruthTableEvaluationPanel) panels[4];
                truthTableEvaluationPanel.setExercise(testExcercise);
                break;
            case VENN:
                VennStudentPanel vennPanel = (VennStudentPanel) panels[5];
                vennPanel.setExercise(testExcercise);
                break;
            case ANALISIS_SILOGISMO:
                SylogismAnalysisPanel sylogismAnalysisPanel = (SylogismAnalysisPanel) panels[6];
                sylogismAnalysisPanel.setExercise(testExcercise);
                break;
            case CREAR_SILOGISMO:
                SylogismFromParameters sylogismFromParameters = (SylogismFromParameters) panels[7];
                sylogismFromParameters.setExercise(testExcercise);
                break;
            case CREAR_POLISILOGISMO:
                PolisilogismoFromParameters polisilogismoFromParameters =
                        (PolisilogismoFromParameters) panels[8];
                polisilogismoFromParameters.setExercise(testExcercise);
                break;
        }
    }
}
